<.focus_box>
  <:title>Enter password</:title>
  <:subtitle>
    This link is password-protected. Please enter the password to continue to the dashboard.
  </:subtitle>
  <.form
    :let={f}
    for={@conn}
    action={Routes.stats_path(@conn, :authenticate_shared_link, @link.slug)  <> "?#{@query_string}"}
    method="post"
  >
    <div class="my-6">
      <.input type="password" field={f[:password]} />

      <%= if @conn.assigns[:error] do %>
        <div class="text-red-500 text-xs mt-1">{@conn.assigns[:error]}</div>
      <% end %>
    </div>

    <.button type="submit" class="w-full">
      Continue
    </.button>
  </.form>
</.focus_box>
